package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;

import org.come.bean.ConfigureBean;
import org.come.entity.Goodstable;
import org.come.model.Configure;
import org.come.mouslisten.ZDCYMouslisten;
import org.come.until.CutButtonImage;
import org.come.until.ScrenceUntil;
import org.come.until.UserMessUntil;
import org.come.until.Util;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.RoleCaoZuoBtn;
import com.tool.tcpimg.UIUtils;

/**
 * 泡点面板
 * @author Administrator
 *
 */
public class ExpAddMapJpanel extends JPanel {
	
	
    private static JTextField findName1;
    private static JLabel time,exp;
    private static RoleCaoZuoBtn sureGive;// 确定查询，取消
    
    private Goodstable good;
    private static String[] Fvalue;
    public String npczb;
    public ExpAddMapJpanel() {

    	ConfigureBean allConfigure = UserMessUntil.getConfigureBean();
		Map<BigDecimal, Configure> item = allConfigure.getAllConfigure();
		Configure configure = item.get(new BigDecimal(1));
		String[] expAdd = configure.getExpAdd().split("\\|");
    	
    	
        this.setPreferredSize(new Dimension(684, 455));
        this.setLayout(null);
        this.setBackground(UIUtils.Color_BACK);
        
        // 关闭按钮事件
        FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/background/gift-close-btn.png", 1, 3003);
        offBtn.setBounds(684-55, 25, 18, 18);
        this.add(offBtn);
        
        //免费泡点
        sureGive = new RoleCaoZuoBtn("inkImg/old/background/paodian-btn.png", 1, "", 30031, UIUtils.COLOR_BTNPUTONG);
        sureGive.setBounds(90, 395, 100, 19);
        this.add(sureGive);
        //金币泡点
        sureGive = new RoleCaoZuoBtn("inkImg/old/background/paodian-btn.png", 1, "", 30032, UIUtils.COLOR_BTNPUTONG);
        sureGive.setBounds(295, 395, 100, 19);
        this.add(sureGive);
        //仙玉泡点
        sureGive = new RoleCaoZuoBtn("inkImg/old/background/paodian-btn.png", 1, "", 30033, UIUtils.COLOR_BTNPUTONG);
        sureGive.setBounds(500, 395, 100, 19);
        this.add(sureGive);
        
        
        time = new JLabel();
        time.setForeground(Color.red);
        time.setFont(UIUtils.TEXT_FONT22);
        time.setBounds(77, 159, 20, 20);
        time.setText(expAdd[0]);
        this.add(time);
        time = new JLabel();
        time.setForeground(Color.red);
        time.setFont(UIUtils.TEXT_FONT22);
        time.setBounds(284, 159, 20, 20);
        time.setText(expAdd[0]);
        this.add(time);
        time = new JLabel();
        time.setForeground(Color.red);
        time.setFont(UIUtils.TEXT_FONT22);
        time.setBounds(546, 159, 20, 20);
        time.setText(expAdd[0]);
        this.add(time);
        
        exp = new JLabel();
        exp.setForeground(Color.red);
        exp.setFont(UIUtils.TEXT_FONT22);
        exp.setBounds(110, 207, 120, 20);
        exp.setText((Long.parseLong(expAdd[1])*2)+"");
        this.add(exp);
        exp = new JLabel();
        exp.setForeground(Color.red);
        exp.setFont(UIUtils.TEXT_FONT22);
        exp.setBounds(320, 207, 120, 20);
        exp.setText(expAdd[1]);
        this.add(exp);
        exp = new JLabel();
        exp.setForeground(Color.red);
        exp.setFont(UIUtils.TEXT_FONT22);
        exp.setBounds(580, 207, 120, 20);
        exp.setText((Long.parseLong(expAdd[1])/10)+"");
        this.add(exp);
        
        
        
        
    }
  
    //进入泡点地图
    public static void iWantToFlyGo(int index) {
    	if(index == 30031) {
    		Util.pdtype = "3";
    		Util.iWantToFly("3344,仙玉泡点,898,698");
    	}else if(index == 30032) {
    		Util.pdtype = "2";
    		Util.iWantToFly("3342,金币泡点,978,697");
    	}else if(index == 30033) {
    		Util.pdtype = "1";
    		Util.iWantToFly("1207,长安城,4020,2720");
    	}else if(index == 30034) {
    		Util.pdtype = "0";
    		Util.hdzjy = 0L;//获得总经验
    		Util.xfzje = 0L;//消费总金额
    		Util.ifpf = false;
    		Util.iWantToFly("1207,长安城,4020,2720");
    	}
    }
    private ImageIcon icon = CutButtonImage.getImage("inkImg/old/background/paodian.png", 684, 455);
    
   
    


    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(icon.getImage(), 0, 0, 684, 455, this);
    }

	public static JTextField getFindName1() {
		return findName1;
	}

	public static void setFindName1(JTextField findName1) {
		ExpAddMapJpanel.findName1 = findName1;
	}

	public Goodstable getGood() {
		return good;
	}

	public void setGood(Goodstable good) {
		this.good = good;
	}

	public String[] getFvalue() {
		return Fvalue;
	}

	public void setFvalue(String[] fvalue) {
		Fvalue = fvalue;
	}
}
